Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(anvil): mostly remove EthTransactionRequest usage, migrate AccessListTracer #6776

Merged
merged 3 commits into from
Jan 12, 2024

Conversation

Evalir
Copy link
Member

@Evalir Evalir commented Jan 12, 2024

Motivation

Part of #6715.

Solution

Removes EthTransactionRequest usage everywhere where its capability to produce TypedTransactions is not required, as this type will be migrated later along with typed receipt, and the block types. This removes a bunch of conversions throughout the API / in-mem backend. Also migrates the AccessListTracer.

crates/anvil/src/eth/api.rs Outdated Show resolved Hide resolved
@Evalir Evalir merged commit 82ec19a into master Jan 12, 2024
19 of 20 checks passed
@Evalir Evalir deleted the evalir/remove-ethtxrequest branch January 12, 2024 16:39
request.data.as_ref().map(|data| data.as_ref().is_empty()).unwrap_or(true);
// If the request is a simple native token transfer we can optimize
// We assume it's a transfer if we have no input data.
let likely_transfer = request.input.clone().into_input().is_none();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let likely_transfer = request.input.clone().into_input().is_none();
let likely_transfer = request.input.input().is_none();

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 ^

Comment on lines +31 to +35
pub fn alloy_to_revm_access_list(list: Vec<AlloyAccessListItem>) -> Vec<(Address, Vec<U256>)> {
list.into_iter()
.map(|item| (item.address, item.storage_keys.into_iter().map(|k| k.into()).collect()))
.collect()
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should ideally make the Alloy Access List compatible with the Revm type directly or with a .into() impl

request.data.as_ref().map(|data| data.as_ref().is_empty()).unwrap_or(true);
// If the request is a simple native token transfer we can optimize
// We assume it's a transfer if we have no input data.
let likely_transfer = request.input.clone().into_input().is_none();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 ^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants